<template>
  <div>
    <el-container>
      <el-header class="header">
        <img :src="pictures.name" alt="" style="width: 50px; height: 50px" />
        <h1>YangYang—新闻管理系统</h1>
      </el-header>
      <el-container>
        <el-aside width="250px">
          <el-menu :default-openeds="['1', '3']">
            <el-menu-item-group style="background-color: #a0a398">
              <el-menu-item>
                <router-link :to="{ name: 'Lunbo' }" exact-active-class="active"
                  >热点首页</router-link
                >
              </el-menu-item>
              <el-menu-item>
                <router-link
                  :to="{ name: 'Article' }"
                  exact-active-class="active"
                  >新闻管理</router-link
                >
              </el-menu-item>
            </el-menu-item-group>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import logo from "../assets/394178928b584b9baf1e2e1b945bd4d0.jpeg";
export default {
  data() {
    return {
      pictures: {
        name: logo,
      },
    };
  },
};
</script>
<style lang="less">
body {
  margin: 0;
}
.active {
  color: #ffffff;
}
.el-header.header {
  background-color: #606266;
  color: #f2f6fc;
  text-align: center;
  height: 60px;
  line-height: 60px;
  display: flex;
  align-items: center;
}
.el-header img {
  border-radius: 50%;
  margin-right: 500px;
  object-fit: cover;
}
.el-header > h1 {
  margin: 0;
}
.el-menu {
  border: 0;
}
.el-menu-item-group__title {
  padding: 0;
}
.el-aside {
  background-color: #c0c4cc;
  text-align: center;
  height: calc(100vh - 60px);
}
li.el-menu-item {
  font-size: 20px;
}
body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
